package com.lagou.edu.interceptor;

import org.springframework.boot.SpringBootConfiguration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @Author wyx
 * @Date 2020/3/2 16:50
 *
 * 注册拦截器
 * Created by SYSTEM on 2017/8/16.
 */
@SpringBootConfiguration
public class WebAppConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册自定义拦截器，添加拦截路径和排除拦截路径
        registry.addInterceptor(new MyIntercepter()).addPathPatterns("/**");//.excludePathPatterns("api/path/login")//排除拦截路径
    }
}